#include "TrilobitaApp.h"

#include "../../include/kernels/PyrolysisTimeDerivativeKernel.h"
#include "../../include/materials/PyrolysisGasPropertyMaterial.h"
#include "Moose.h"
#include "AppFactory.h"
#include "ModulesApp.h"
#include "MooseSyntax.h"
#include "ComputeRhoMaterial.h"
#include "MUltiPhasePyrolysisMaterial.h"
#include "SinglePhasePyrolysisMaterial.h"
#include "PyrolysisHeatDiffusionKernel.h"
#include "PyrolysisRhoKernel.h"
#include "PyrolysisTimeDerivativeKernel.h"
#include "PyrolysisHeatSourceKernal.h"
#include "PorePressureTimeDerivativeKernel.h"
#include "PoreTemperatureTimeAsSourceKernel.h"
#include "PorePressureDiffusionKernel.h"
#include "PoreGasSourceKernel.h"
#include "PorosityTimeDerivativeKernel.h"
#include "PyrolysisGasEnergyKernel.h"
#include "EnthalpyChangeKernel.h"
#include "GetCharPercentAux.h"

//template<>
//InputParameters validParams<TrilobitaApp>()
//{
//  InputParameters params = validParams<MooseApp>();
//
////  params.set<bool>("use_legacy_uo_initialization") = false;
////  params.set<bool>("use_legacy_uo_aux_computation") = false;
////  params.set<bool>("use_legacy_output_syntax") = false;
//
//  return params;
//}
//
//TrilobitaApp::TrilobitaApp(InputParameters parameters) :
//    MooseApp(parameters)
//{
////  Moose::registerObjects(_factory);
////  ModulesApp::registerObjects(_factory);
////  TrilobitaApp::registerObjects(_factory);
////
////  Moose::associateSyntax(_syntax, _action_factory);
////  ModulesApp::associateSyntax(_syntax, _action_factory);
////  TrilobitaApp::associateSyntax(_syntax, _action_factory);
//	TrilobitaApp::registerAll(_factory, _action_factory, _syntax);
//}
//
//
//TrilobitaApp::~TrilobitaApp()
//{
//}
//
//// External entry point for dynamic application loading
//extern "C" void TrilobitaApp__registerApps() { TrilobitaApp::registerApps(); }
//void
//TrilobitaApp::registerApps()
//{
//  registerApp(TrilobitaApp);
//}
//
//// External entry point for dynamic object registration
//extern "C" void TrilobitaApp__registerObjects(Factory & factory) { TrilobitaApp::registerObjects(factory); }
//void
//TrilobitaApp::registerObjects(Factory & factory)
//{
//	registerMaterial(ComputeRhoMaterial);
//	registerMaterial(MUltiPhasePyrolysisMaterial);
//	registerMaterial(SinglePhasePyrolysisMaterial);
//	registerMaterial(PyrolysisGasPropertyMaterial);
//
//	registerKernel(PyrolysisTimeDerivativeKernel);
//	registerKernel(PyrolysisHeatDiffusionKernel);
//	registerKernel(PyrolysisHeatSourceKernal);
//	registerKernel(PyrolysisRhoKernel);
//	registerKernel(PorePressureTimeDerivativeKernel);
//	registerKernel(PoreTemperatureTimeAsSourceKernel);
//	registerKernel(PorePressureDiffusionKernel);
//	registerKernel(PoreGasSourceKernel);
//	registerKernel(PorosityTimeDerivativeKernel);
//	registerKernel(PyrolysisGasEnergyKernel);
//	registerKernel(EnthalpyChangeKernel);
//	registerAux(GetCharPercentAux);
//
//}
//
//// External entry point for dynamic syntax association
//extern "C" void TrilobitaApp__associateSyntax(Syntax & syntax, ActionFactory & action_factory) { TrilobitaApp::associateSyntax(syntax, action_factory); }
//void
//TrilobitaApp::associateSyntax(Syntax & /*syntax*/, ActionFactory & /*action_factory*/)
//{
//}

template <>
InputParameters
validParams<TrilobitaApp>()
{
  InputParameters params = validParams<MooseApp>();
  return params;
}

TrilobitaApp::TrilobitaApp(InputParameters parameters) : MooseApp(parameters)
{
	TrilobitaApp::registerAll(_factory, _action_factory, _syntax);
}

TrilobitaApp::~TrilobitaApp() {}

void
TrilobitaApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
  ModulesApp::registerAll(f, af, s);
  Registry::registerObjectsTo(f, {"TrilobitaApp"});
  Registry::registerActionsTo(af, {"TrilobitaApp"});




  /* register custom execute flags, action syntax, etc. here */
}

void
TrilobitaApp::registerApps()
{
  registerApp(TrilobitaApp);
}

/***************************************************************************************************
 *********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
 **************************************************************************************************/
extern "C" void
TrilobitaApp__registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
	TrilobitaApp::registerAll(f, af, s);
}
extern "C" void
TrilobitaApp__registerApps()
{
	TrilobitaApp::registerApps();
}


